namespace Gu.Wpf.DataGrid2D.Tests.Views.Stubs;

using System.ComponentModel;
using System.Runtime.CompilerServices;

public class Person : INotifyPropertyChanged
{
    private string? firstName;
    private string? lastName;

    public event PropertyChangedEventHandler? PropertyChanged;

    public string? FirstName
    {
        get => this.firstName;

        set
        {
            if (value == this.firstName)
            {
                return;
            }

            this.firstName = value;
            this.OnPropertyChanged();
        }
    }

    public string? LastName
    {
        get => this.lastName;

        set
        {
            if (value == this.lastName)
            {
                return;
            }

            this.lastName = value;
            this.OnPropertyChanged();
        }
    }

    protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
    {
        this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
}
